<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GOutputStream</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="GIO Reference Manual">
<link rel="up" href="streaming.html" title="Streaming I/O">
<link rel="prev" href="GInputStream.html" title="GInputStream">
<link rel="next" href="GFileInputStream.html" title="GFileInputStream">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="pt01.html" title="Part&#160;I.&#160;GIO Overview">
<link rel="chapter" href="ch01.html" title="Introduction">
<link rel="chapter" href="ch02.html" title="Compiling GIO applications">
<link rel="chapter" href="ch03.html" title="Running GIO applications">
<link rel="chapter" href="gio-extension-points.html" title="Extending GIO">
<link rel="part" href="pt02.html" title="Part&#160;II.&#160;API Reference">
<link rel="chapter" href="file_ops.html" title="File Operations">
<link rel="chapter" href="file_mon.html" title="File System Monitoring">
<link rel="chapter" href="async.html" title="Asynchronous I/O">
<link rel="chapter" href="streaming.html" title="Streaming I/O">
<link rel="chapter" href="types.html" title="File types and applications">
<link rel="chapter" href="volume_mon.html" title="Volumes and Drives">
<link rel="chapter" href="icons.html" title="Icons">
<link rel="chapter" href="utils.html" title="Utilities">
<link rel="chapter" href="extending.html" title="Extending GIO">
<link rel="part" href="migrating.html" title="Part&#160;III.&#160;Migrating to GIO">
<link rel="chapter" href="ch14.html" title="Migrating from POSIX to GIO">
<link rel="chapter" href="ch15.html" title="Migrating from GnomeVFS to GIO">
<link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GInputStream.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="streaming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="GFileInputStream.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2774597" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2853666" class="shortcut">Description</a>
                  &#160;|&#160;
                  <a href="#id2853617" class="shortcut">Object Hierarchy</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="GOutputStream"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2774597"></a><span class="refentrytitle">GOutputStream</span>
</h2>
<p>GOutputStream &#8212; Base class for implementing streaming output</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;gio/gio.h&gt;


enum                <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a>;
                    <a class="link" href="GOutputStream.html#GOutputStream-struct">GOutputStream</a>;
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              <a class="link" href="GOutputStream.html#g-output-stream-write">g_output_stream_write</a>               (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         const void *buffer,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-write-all">g_output_stream_write_all</a>           (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         const void *buffer,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> *bytes_written,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              <a class="link" href="GOutputStream.html#g-output-stream-splice">g_output_stream_splice</a>              (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *source,
                                                         <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-flush">g_output_stream_flush</a>               (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-close">g_output_stream_close</a>               (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
void                <a class="link" href="GOutputStream.html#g-output-stream-write-async">g_output_stream_write_async</a>         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         const void *buffer,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              <a class="link" href="GOutputStream.html#g-output-stream-write-finish">g_output_stream_write_finish</a>        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
void                <a class="link" href="GOutputStream.html#g-output-stream-splice-async">g_output_stream_splice_async</a>        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *source,
                                                         <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              <a class="link" href="GOutputStream.html#g-output-stream-splice-finish">g_output_stream_splice_finish</a>       (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
void                <a class="link" href="GOutputStream.html#g-output-stream-flush-async">g_output_stream_flush_async</a>         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-flush-finish">g_output_stream_flush_finish</a>        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
void                <a class="link" href="GOutputStream.html#g-output-stream-close-async">g_output_stream_close_async</a>         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-close-finish">g_output_stream_close_finish</a>        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-is-closed">g_output_stream_is_closed</a>           (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-has-pending">g_output_stream_has_pending</a>         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GOutputStream.html#g-output-stream-set-pending">g_output_stream_set_pending</a>         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
void                <a class="link" href="GOutputStream.html#g-output-stream-clear-pending">g_output_stream_clear_pending</a>       (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);


</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2853617"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">

  <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
   +----GOutputStream
         +----<a class="link" href="GFilterOutputStream.html" title="GFilterOutputStream">GFilterOutputStream</a>
         +----<a class="link" href="GUnixOutputStream.html" title="GUnixOutputStream">GUnixOutputStream</a>
         +----<a class="link" href="GFileOutputStream.html" title="GFileOutputStream">GFileOutputStream</a>
         +----<a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream">GMemoryOutputStream</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2853666"></a><h2>Description</h2>
<p>
</p>
<p>

</p>
</div>
<div class="refsect1" lang="en">
<a name="id2853686"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2853697"></a><h3>
<a name="GOutputStreamSpliceFlags"></a>enum GOutputStreamSpliceFlags</h3>
<a class="indexterm" name="id2853708"></a><pre class="programlisting">typedef enum {
  G_OUTPUT_STREAM_SPLICE_NONE = 0,
  G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = 1 &lt;&lt; 0,
  G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET = 1 &lt;&lt; 1
} GOutputStreamSpliceFlags;
</pre>
<p>
GOutputStreamSpliceFlags determine how streams should be spliced.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a name="G-OUTPUT-STREAM-SPLICE-NONE:CAPS"></a><code class="literal">G_OUTPUT_STREAM_SPLICE_NONE</code></span></p></td>
<td> Do not close either stream.
</td>
</tr>
<tr>
<td><p><span class="term"><a name="G-OUTPUT-STREAM-SPLICE-CLOSE-SOURCE:CAPS"></a><code class="literal">G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE</code></span></p></td>
<td> Close the source stream after the splice.
</td>
</tr>
<tr>
<td><p><span class="term"><a name="G-OUTPUT-STREAM-SPLICE-CLOSE-TARGET:CAPS"></a><code class="literal">G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET</code></span></p></td>
<td> Close the target stream after the splice.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2853798"></a><h3>
<a name="GOutputStream-struct"></a>GOutputStream</h3>
<a class="indexterm" name="id2853809"></a><pre class="programlisting">typedef struct _GOutputStream GOutputStream;</pre>
<p>
Base class for writing output. 
</p>
<p>
All classes derived from GOutputStream should implement synchronous 
writing, splicing, flushing and closing streams, but may implement
asynchronous versions.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2853836"></a><h3>
<a name="g-output-stream-write"></a>g_output_stream_write ()</h3>
<a class="indexterm" name="id2853847"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              g_output_stream_write               (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         const void *buffer,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Tries to write <em class="parameter"><code>count</code></em> bytes from <em class="parameter"><code>buffer</code></em> into the stream. Will block
during the operation.
</p>
<p>
If count is zero returns zero and does nothing. A value of <em class="parameter"><code>count</code></em>
larger than <a
href="/usr/share/gtk-doc/html/glib/glib-Limits-of-Basic-Types.html#G-MAXSSIZE:CAPS"
><code class="literal">G_MAXSSIZE</code></a> will cause a <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a> error.
</p>
<p>
On success, the number of bytes written to the stream is returned.
It is not an error if this is not the same as the requested size, as it
can happen e.g. on a partial i/o error, or if there is not enough
storage in the stream. All writes either block until at least one byte
is written, so zero is never returned (unless <em class="parameter"><code>count</code></em> is zero).
</p>
<p>
If <em class="parameter"><code>cancellable</code></em> is not NULL, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an
operation was partially finished when the operation was cancelled the
partial result will be returned, without an error.
</p>
<p>
On error -1 is returned and <em class="parameter"><code>error</code></em> is set accordingly.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em>&#160;:</span></p></td>
<td> the buffer containing the data to write. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>count</code></em>&#160;:</span></p></td>
<td> the number of bytes to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional cancellable object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> Number of bytes written, or -1 on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2854092"></a><h3>
<a name="g-output-stream-write-all"></a>g_output_stream_write_all ()</h3>
<a class="indexterm" name="id2854104"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_write_all           (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         const void *buffer,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> *bytes_written,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Tries to write <em class="parameter"><code>count</code></em> bytes from <em class="parameter"><code>buffer</code></em> into the stream. Will block
during the operation.
</p>
<p>
This function is similar to <a class="link" href="GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a>, except it tries to
write as many bytes as requested, only stopping on an error.
</p>
<p>
On a successful write of <em class="parameter"><code>count</code></em> bytes, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> is returned, and <em class="parameter"><code>bytes_written</code></em>
is set to <em class="parameter"><code>count</code></em>.
</p>
<p>
If there is an error during the operation FALSE is returned and <em class="parameter"><code>error</code></em>
is set to indicate the error status, <em class="parameter"><code>bytes_written</code></em> is updated to contain
the number of bytes written into the stream before the error occurred.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em>&#160;:</span></p></td>
<td> the buffer containing the data to write. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>count</code></em>&#160;:</span></p></td>
<td> the number of bytes to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bytes_written</code></em>&#160;:</span></p></td>
<td> location to store the number of bytes that was 
    written to the stream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> on success, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> if there was an error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2854402"></a><h3>
<a name="g-output-stream-splice"></a>g_output_stream_splice ()</h3>
<a class="indexterm" name="id2854413"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              g_output_stream_splice              (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *source,
                                                         <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Splices an input stream into an output stream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</span></p></td>
<td> a set of <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to 
ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
><span class="type">gssize</span></a> containing the size of the data spliced.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2854622"></a><h3>
<a name="g-output-stream-flush"></a>g_output_stream_flush ()</h3>
<a class="indexterm" name="id2854633"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_flush               (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Flushed any outstanding buffers in the stream. Will block during 
the operation. Closing the stream will implicitly cause a flush.
</p>
<p>
This function is optional for inherited classes.
</p>
<p>
If <em class="parameter"><code>cancellable</code></em> is not <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional cancellable object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> on success, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2854809"></a><h3>
<a name="g-output-stream-close"></a>g_output_stream_close ()</h3>
<a class="indexterm" name="id2854820"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_close               (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Closes the stream, releasing resources related to it.
</p>
<p>
Once the stream is closed, all other operations will return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>.
Closing a stream multiple times will not return an error.
</p>
<p>
Closing a stream will automatically flush any outstanding buffers in the
stream.
</p>
<p>
Streams will be automatically closed when the last reference
is dropped, but you might want to call this function to make sure 
resources are released as early as possible.
</p>
<p>
Some streams might keep the backing store of the stream (e.g. a file descriptor)
open after the stream is closed. See the documentation for the individual
stream for details.
</p>
<p>
On failure the first error that happened will be reported, but the close
operation will finish as much as possible. A stream that failed to
close will still return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a> for all operations. Still, it
is important to check and report the error to the user, otherwise
there might be a loss of data as all data might not be written.
</p>
<p>
If <em class="parameter"><code>cancellable</code></em> is not NULL, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.
Cancelling a close will still leave the stream closed, but there some streams
can use a faster close that doesn't block to e.g. check errors. On
cancellation (as with any error) there is no guarantee that all written
data will reach the target.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional cancellable object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> on success, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2855037"></a><h3>
<a name="g-output-stream-write-async"></a>g_output_stream_write_async ()</h3>
<a class="indexterm" name="id2855048"></a><pre class="programlisting">void                g_output_stream_write_async         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         const void *buffer,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"
>gsize</a> count,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
Request an asynchronous write of <em class="parameter"><code>count</code></em> bytes from <em class="parameter"><code>buffer</code></em> into 
the stream. When the operation is finished <em class="parameter"><code>callback</code></em> will be called.
You can then call <a class="link" href="GOutputStream.html#g-output-stream-write-finish"><code class="function">g_output_stream_write_finish()</code></a> to get the result of the 
operation.
</p>
<p>
During an async request no other sync and async calls are allowed, 
and will result in <a class="link" href="gio-GIOError.html#G-IO-ERROR-PENDING:CAPS"><code class="literal">G_IO_ERROR_PENDING</code></a> errors. 
</p>
<p>
A value of <em class="parameter"><code>count</code></em> larger than <a
href="/usr/share/gtk-doc/html/glib/glib-Limits-of-Basic-Types.html#G-MAXSSIZE:CAPS"
><code class="literal">G_MAXSSIZE</code></a> will cause a 
<a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a> error.
</p>
<p>
On success, the number of bytes written will be passed to the
<em class="parameter"><code>callback</code></em>. It is not an error if this is not the same as the 
requested size, as it can happen e.g. on a partial I/O error, 
but generally we try to write as many bytes as requested. 
</p>
<p>
Any outstanding I/O request with higher priority (lower numerical 
value) will be executed before an outstanding request with lower 
priority. Default priority is <a
href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS"
><code class="literal">G_PRIORITY_DEFAULT</code></a>.
</p>
<p>
The asyncronous methods have a default fallback that uses threads 
to implement asynchronicity, so they are optional for inheriting 
classes. However, if you override one you must override all.
</p>
<p>
For the synchronous, blocking version of this function, see 
<a class="link" href="GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em>&#160;:</span></p></td>
<td> the buffer containing the data to write. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>count</code></em>&#160;:</span></p></td>
<td> the number of bytes to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em>&#160;:</span></p></td>
<td> the io priority of the request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em>&#160;:</span></p></td>
<td> callback to call when the request is satisfied
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td> the data to pass to callback function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2855376"></a><h3>
<a name="g-output-stream-write-finish"></a>g_output_stream_write_finish ()</h3>
<a class="indexterm" name="id2855389"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              g_output_stream_write_finish        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Finishes a stream write operation.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to 
ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
><span class="type">gssize</span></a> containing the number of bytes written to the stream.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2855533"></a><h3>
<a name="g-output-stream-splice-async"></a>g_output_stream_splice_async ()</h3>
<a class="indexterm" name="id2855546"></a><pre class="programlisting">void                g_output_stream_splice_async        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *source,
                                                         <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags">GOutputStreamSpliceFlags</a> flags,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
Splices a stream asynchronously.
When the operation is finished <em class="parameter"><code>callback</code></em> will be called.
You can then call <a class="link" href="GOutputStream.html#g-output-stream-splice-finish"><code class="function">g_output_stream_splice_finish()</code></a> to get the 
result of the operation.
</p>
<p>
For the synchronous, blocking version of this function, see 
<a class="link" href="GOutputStream.html#g-output-stream-splice"><code class="function">g_output_stream_splice()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</span></p></td>
<td> a set of <a class="link" href="GOutputStream.html#GOutputStreamSpliceFlags"><span class="type">GOutputStreamSpliceFlags</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em>&#160;:</span></p></td>
<td> the io priority of the request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a>. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td> user data passed to <em class="parameter"><code>callback</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2857339"></a><h3>
<a name="g-output-stream-splice-finish"></a>g_output_stream_splice_finish ()</h3>
<a class="indexterm" name="id2857352"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
>gssize</a>              g_output_stream_splice_finish       (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Finishes an asynchronous stream splice operation.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to 
ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"
><span class="type">gssize</span></a> of the number of bytes spliced.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2857480"></a><h3>
<a name="g-output-stream-flush-async"></a>g_output_stream_flush_async ()</h3>
<a class="indexterm" name="id2857491"></a><pre class="programlisting">void                g_output_stream_flush_async         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
Flushes a stream asynchronously.
For behaviour details see <a class="link" href="GOutputStream.html#g-output-stream-flush"><code class="function">g_output_stream_flush()</code></a>.
</p>
<p>
When the operation is finished <em class="parameter"><code>callback</code></em> will be 
called. You can then call <a class="link" href="GOutputStream.html#g-output-stream-flush-finish"><code class="function">g_output_stream_flush_finish()</code></a> to get the 
result of the operation.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em>&#160;:</span></p></td>
<td> the io priority of the request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td> the data to pass to callback function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2857670"></a><h3>
<a name="g-output-stream-flush-finish"></a>g_output_stream_flush_finish ()</h3>
<a class="indexterm" name="id2857683"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_flush_finish        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Finishes flushing an output stream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em>&#160;:</span></p></td>
<td> a GAsyncResult.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to 
ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if flush operation suceeded, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2857815"></a><h3>
<a name="g-output-stream-close-async"></a>g_output_stream_close_async ()</h3>
<a class="indexterm" name="id2857826"></a><pre class="programlisting">void                g_output_stream_close_async         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         int io_priority,
                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
Requests an asynchronous close of the stream, releasing resources 
related to it. When the operation is finished <em class="parameter"><code>callback</code></em> will be 
called. You can then call <a class="link" href="GOutputStream.html#g-output-stream-close-finish"><code class="function">g_output_stream_close_finish()</code></a> to get 
the result of the operation.
</p>
<p>
For behaviour details see <a class="link" href="GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a>.
</p>
<p>
The asyncronous methods have a default fallback that uses threads 
to implement asynchronicity, so they are optional for inheriting 
classes. However, if you override one you must override all.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> A <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em>&#160;:</span></p></td>
<td> the io priority of the request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td>
<td> optional cancellable object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em>&#160;:</span></p></td>
<td> callback to call when the request is satisfied
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td> the data to pass to callback function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2857992"></a><h3>
<a name="g-output-stream-close-finish"></a>g_output_stream_close_finish ()</h3>
<a class="indexterm" name="id2858005"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_close_finish        (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Closes an output stream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to 
ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if stream was successfully closed, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2858142"></a><h3>
<a name="g-output-stream-is-closed"></a>g_output_stream_is_closed ()</h3>
<a class="indexterm" name="id2858153"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_is_closed           (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);</pre>
<p>
Checks if an output stream has already been closed.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em> is closed. <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> otherwise. 
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2858236"></a><h3>
<a name="g-output-stream-has-pending"></a>g_output_stream_has_pending ()</h3>
<a class="indexterm" name="id2858247"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_has_pending         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);</pre>
<p>
Checks if an ouput stream has pending actions.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if <em class="parameter"><code>stream</code></em> has pending actions. 
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2858321"></a><h3>
<a name="g-output-stream-set-pending"></a>g_output_stream_set_pending ()</h3>
<a class="indexterm" name="id2858332"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            g_output_stream_set_pending         (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Sets <em class="parameter"><code>stream</code></em> to have actions pending. If the pending flag is
already set or <em class="parameter"><code>stream</code></em> is closed, it will return <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> and set
<em class="parameter"><code>error</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to 
ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if pending was previously unset and is now set.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2858460"></a><h3>
<a name="g-output-stream-clear-pending"></a>g_output_stream_clear_pending ()</h3>
<a class="indexterm" name="id2858473"></a><pre class="programlisting">void                g_output_stream_clear_pending       (<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a> *stream);</pre>
<p>
Clears the pending flag on <em class="parameter"><code>stream</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td>
<td> output stream
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2858524"></a><div class="refsect2" lang="en"><a name="id2858525"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id2858526"></a></div>
</div>
</div>
</body>
</html>
